From: Fabian Grünbichler Date: Tue, 16 Dec 2025 10:45:36 +0000 (+0100) Subject: Enable file locking support for Hurd X-Git-Tag: archive/raspbian/1.92.0+dfsg1-2+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/%22stanciumarius94%40gmail.com//%22mailto:i18n-csb%40linuxcsb.org/%22/%22http:/www.example.com/%22stanciumarius94%40gmail.com/%22mailto:i18n-csb%40linuxcsb.org/%22?a=commitdiff_plain;h=d29fd22dff06065b981c8101bd108752136c411f;p=rustc.git Enable file locking support for Hurd like Illumos in #148322, Hurd was missed when originally introducing locking gates per target OS in #132977. building rustc on Hurd was broken as a result since 1.91. Signed-off-by: Fabian Grünbichler Gbp-Pq: Topic upstream Gbp-Pq: Name Enable-file-locking-support-for-Hurd.patch --- diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 0517760c35..6e89728196 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -226,6 +226,7 @@ fn file_test_io_seek_and_write() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -251,6 +252,7 @@ fn file_lock_multiple_shared() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -277,6 +279,7 @@ fn file_lock_blocking() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -300,6 +303,7 @@ fn file_lock_drop() { #[cfg(any( windows, target_os = "freebsd", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs index 3efe67390d..df03fb5604 100644 --- a/library/std/src/sys/fs/unix.rs +++ b/library/std/src/sys/fs/unix.rs @@ -1288,6 +1288,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1312,6 +1313,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1327,6 +1329,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1351,6 +1354,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1366,6 +1370,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1406,6 +1411,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1424,6 +1430,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1464,6 +1471,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1482,6 +1490,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1506,6 +1515,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd",